package com.zpy.SmartChargeStation.mqtt.client.service;


import com.zpy.SmartChargeStation.mqtt.client.model.MqttConstants;
import com.zpy.SmartChargeStation.protocol.mqtt.message.ChargePayload;
import org.springframework.integration.annotation.IntegrationComponentScan;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.Message;
import org.springframework.messaging.handler.annotation.Header;

@IntegrationComponentScan
@MessagingGateway(defaultRequestChannel = MqttConstants.OUT_CHANNEL)
public interface MqttService {

    //发送消息
    void send(@Header(MqttHeaders.TOPIC)String topic, ChargePayload message);

    //发送消息
    void send(@Header(MqttHeaders.TOPIC)String topic, Message<byte[]> message);
}
